#include "fxcc/yml/Serializer.h"
#include "fxcc/core/graph/common/Viewport.h"

using namespace fxcc::yml;
using CurrentType = fxcc::graph::common::Viewport;;

template<>
void Serializer::Encode<CurrentType>(YAML::Node& node, const CurrentType& inst)
{
	SetVariable<float>(node, "left", inst.left);
	SetVariable<float>(node, "right", inst.right);
	SetVariable<float>(node, "bottom", inst.bottom);
	SetVariable<float>(node, "top", inst.top);
	SetVariable<float>(node, "nearZ", inst.zNear);
	SetVariable<float>(node, "farZ", inst.zFar);


}


template<>
bool Serializer::Decode<CurrentType>(const YAML::Node& node, CurrentType& inst)
{

	GetVariable<float>(node, "left", inst.left);
	GetVariable<float>(node, "right", inst.right);
	GetVariable<float>(node, "bottom", inst.bottom);
	GetVariable<float>(node, "top", inst.top);
	GetVariable<float>(node, "nearZ", inst.zNear);
	GetVariable<float>(node, "farZ", inst.zFar);
	return true;
}
